package library.push;

import android.os.Bundle;

import java.io.Serializable;

import cn.jpush.android.api.JPushInterface;

/**
 * @author Created by qiang.hou on 2018/4/17.
 * @version 1.0
 */
public class PushData implements Serializable {
    private String title;
    private String message;
    private String dataString;

    public PushData(boolean isMessageType, Bundle data) {
        if (isMessageType) {
            title = data.getString(JPushInterface.EXTRA_TITLE);
            message = data.getString(JPushInterface.EXTRA_MESSAGE);
            dataString = data.getString(JPushInterface.EXTRA_EXTRA);
        } else {
            title = data.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE);
            message = data.getString(JPushInterface.EXTRA_ALERT);
            dataString = data.getString(JPushInterface.EXTRA_EXTRA);
        }
    }

    public String getTitle() {
        return title;
    }

    public String getMessage() {
        return message;
    }

    public String getDataString() {
        return dataString;
    }
}
